package org.binglan.youziyuepai.mapper;

import org.apache.ibatis.annotations.Select;
import org.binglan.youziyuepai.entity.ActivityToUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 * 活动与用户多对多表 Mapper 接口
 * </p>
 *
 * @author sanjin
 * @since 2019-04-11
 */
public interface ActivityToUserMapper extends BaseMapper<ActivityToUser> {

    @Select("SELECT\n" +
            "\t* \n" +
            "FROM\n" +
            "\t`activity_to_user` atu,\n" +
            "\tactivity a \n" +
            "WHERE\n" +
            "\tatu.activity_id = a.id \n" +
            "\tAND a.user_id = #{userId}")
    List<ActivityToUser> queryActivityToUsersByReceiveUserId(String userId);
}
